package com.pikaqiu.warehouse.domain.dto;

import com.pikaqiu.warehouse.domain.entity.Materials;
import com.pikaqiu.warehouse.domain.entity.Products;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: Administrator
 * @Date: 2024/8/15
 */
@Data
public class MaterialProductInfoDto {

    private Integer id;

    private String code;

    private String name;

    private String desc;

    private String image;

    private String unit;

    private BigDecimal price;

    private BigDecimal salary;

    private BigDecimal stock;

    private String categoryName;

    List<ProductMaterialsLinkDto> linkList;

    public MaterialProductInfoDto(Products products, String categoryName, List<ProductMaterialsLinkDto> linkList) {
        this.id = products.getId();
        this.code = products.getCode();
        this.name = products.getName();
        this.desc = products.getDescription();
        this.image = products.getImages();
        this.unit = products.getUnit();
        this.price = products.getPrice();
        this.salary = products.getSalary();
        this.stock = products.getStock();
        this.categoryName = categoryName;
        this.linkList = linkList;
    }

    public MaterialProductInfoDto(Materials materials, String categoryName, List<ProductMaterialsLinkDto> linkList) {
        this.id = materials.getId();
        this.code = materials.getCode();
        this.name = materials.getName();
        this.desc = materials.getDescription();
        this.image = materials.getImages();
        this.unit = materials.getUnit();
        this.price = materials.getPrice();
        this.salary = materials.getSalary();
        this.stock = materials.getStock();
        this.categoryName = categoryName;
        this.linkList = linkList;
    }
}
